#ifndef STM32_SPI_H_INCLUDED
#define STM32_SPI_H_INCLUDED

#ifdef USING_SPI

#include <device.h>

#include "stm32f0xx.h"

struct stm32_spi_bus
{
    struct spi_bus parent;
    SPI_TypeDef *SPI;
};

struct stm32_spi_cs
{
    GPIO_TypeDef *GPIOx;
    uint16_t GPIO_Pin;
};

/* public function list */
err_t stm32_spi_register(SPI_TypeDef *SPI,
                         struct stm32_spi_bus *stm32_spi,
                         const char *spi_bus_name);
void board_setup_spi(void);
#endif
#endif // STM32_SPI_H_INCLUDED
